﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BaoJian.member.exchange
{
    public partial class Detail : System.Web.UI.Page
    {
        private string UserID = HttpContext.Current.User.Identity.Name;
        private LYQ.BLL.ExchangeProduct bll = new LYQ.BLL.ExchangeProduct();
        private int SID;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current.Request.QueryString["SID"] == null)
                return;
            else
            {
               SID= Convert.ToInt32(HttpContext.Current.Request.QueryString["SID"]);
            }
            if (!Page.IsPostBack)
            {
                Tools.Common.IsAuthenticated();
                BindData();
            }

        }

        private void BindData()
        {
            LYQ.BLL.ExchangeProduct bll = new LYQ.BLL.ExchangeProduct();           
            LYQ.Model.ExchangeProduct model = bll.GetModel(SID);
            this.lblOrderID.Text = model.OrderID.ToString();
            this.lblCustomerID.Text = model.CustomerID;
            this.lblPName.Text = model.PName;
            this.lblDescription.Text = model.Description;
            this.lblTotalNum.Text = model.TotalNum.ToString();
            this.lblRegDate.Text = model.RegDate.ToString();
            this.lblDeadline.Text = model.Deadline.ToString();
            this.lblProduceDate.Text = model.ProduceDate.ToString();
            this.lblExpireDate.Text = model.ExpireDate.ToString();
            this.lblDays.Text = model.Days.ToString();
            this.lblRegion.Text = model.Region;
            this.lblPublish.Text = model.Publish;
            this.lblPrice.Text = model.Price.ToString();
            this.lblBrowserCount.Text = model.BrowserCount.ToString();
            this.lblExchangeReason.Text = model.ExchangeReason;
            this.lblCustomerIP.Text = model.CustomerIP;
            this.lblFeedBack.Text = model.FeedBack;
            this.lblNeededProducts.Text = model.NeededProducts;
        }
    }
}
